CacheClient

class CacheClient(userAgent: String)

Cache accessors, similar to @actions/cache

Constructors

CacheClient
Link copied to clipboard
fun CacheClient(userAgent: String = "Kotlin/JS GitHub Action wrapper")

Functions

commitCache
Link copied to clipboard
suspend fun commitCache(cacheId: Int, dataSize: Long)
Commit a cache
downloadCacheEntry
Link copied to clipboard
suspend fun downloadCacheEntry(destination: Path, keys: List<String>, version: String): Boolean
Try to download a cache entry
downloadFile
Link copied to clipboard
suspend fun downloadFile(url: String, destination: Path)
Download a file
getCacheApiUrl
Link copied to clipboard
fun getCacheApiUrl(resource: String): String
getCacheEntry
Link copied to clipboard
suspend fun getCacheEntry(keys: List<String>, version: String): CacheEntry?
Get a cache entry for the keys and version, or null if none exists
hasCache
Link copied to clipboard
suspend fun hasCache(keys: List<String>, version: String): Boolean
Get whether a cache exists for these keys and version
readCacheEntry
Link copied to clipboard
suspend fun readCacheEntry(keys: List<String>, version: String): String?
Read a cache entry
readUrl
Link copied to clipboard
suspend fun readUrl(url: String): String
Read text from a url
reserveCache
Link copied to clipboard
suspend fun reserveCache(key: String, version: String): Int?
Reserve a cache key
saveFile
Link copied to clipboard
suspend fun saveFile(cacheId: Int, file: Path, concurrency: Int = 4, maxChunkSize: Long = 32 * 1024 * 1024)
Upload a file to the cache and then commit it
saveText
Link copied to clipboard
suspend fun saveText(cacheId: Int, text: String)
Upload text to the cache and then commit it
uploadChunk
Link copied to clipboard
suspend fun uploadChunk(cacheId: Int, openStream: () -> <ERROR CLASS>, start: Long, end: Long)
Upload a chunk to a reserved cache id.
uploadFile
Link copied to clipboard
suspend fun uploadFile(cacheId: Int, file: Path, concurrency: Int = 4, maxChunkSize: Long = 32 * 1024 * 1024)
Upload a file to a reserved cache id, using concurrency.
uploadText
Link copied to clipboard
suspend fun uploadText(cacheId: Int, text: String)
Upload text to a reserved cache id.

Sources

js source
Link copied to clipboard